package com.changli01.file;

import org.junit.Test;

import java.io.File;

public class fileTest {
    @Test
    public void test() {
        File file1 = new File("D:\\后端\\csust.txt");
//        System.out.println(file1.getAbsoluteFile());
//        System.out.println(file1.getPath());
        File file2 = new File("D:\\后端\\hello.txt");
        boolean b = file1.renameTo(file2);
        System.out.println(b?"修改成功":"修改失败");
    }

}
